package it.polito.let.jhp.types;

import java.io.Serializable;

public class Value implements Serializable {

	private static final long serialVersionUID = 197364825686928382L;

	private TypeCode type;

	private Object val;

	public Value(TypeCode t, Object o) {
		type = t;
		val = o;
	}

	public TypeCode getType() {
		return type;
	}

	public Object getVal() {
		return val;
	}

	public boolean equals(Object o) {
		if (o instanceof Value) {
			Value v = (Value) o;
			return v.getType().equals(this.getType()) && v.getVal().equals(this.getVal());
		}
		return false;
	}

}
